﻿using System.Net.Http;

namespace HttpClientLite.Handlers.interfaces;

/// <summary>
/// HttpResponseMessage处理接口
/// </summary>
public interface IResponseMessageHandler
{
    /// <summary>
    /// 异步处理
    /// </summary>
    /// <param name="httpManager"></param>
    /// <param name="httpClient"></param>
    /// <param name="cloneHttpRequest">根据已经使用的HttpRequestMessage克隆出来新的HttpRequestMessage</param>
    /// <param name="httpResponseMessage"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<HttpResponseMessage> HandleAsync(HttpManagerBase httpManager,
                                          HttpClient httpClient,
                                          HttpRequestMessage cloneHttpRequest,
                                          HttpResponseMessage httpResponseMessage,
                                          CancellationToken? cancellationToken = null);

    ///// <summary>
    ///// 处理
    ///// </summary>
    ///// <param name="httpManager"></param>
    ///// <param name="httpClient"></param>
    ///// <param name="cloneHttpRequest">根据已经使用的HttpRequestMessage克隆出来新的HttpRequestMessage</param>
    ///// <param name="httpResponseMessage"></param>
    ///// <returns></returns>
    //HttpResponseMessage Handle(HttpManagerBase httpManager,
    //                           HttpClient httpClient,
    //                           HttpRequestMessage cloneHttpRequest,
    //                           HttpResponseMessage httpResponseMessage);
}